<?php
class main extends spController
{ 
    function __construct(){  
        parent::__construct();
    }
    

     


	function index(){
		echo "this site is on building , please wait!";
	}

	function get_request(){
		$header = apache_request_headers();
		//$request_header = http_get_request_headers();
		
		$body = http_get_request_body();
		$uri = $_SERVER['REQUEST_URI'];
		$method = $_SERVER['REQUEST_METHOD'];


		$request['header'] = $header;
		$request['body'] = $body;
		$request['uri'] = $uri;
		$request['method'] = $method;

		return $request;

	
	}
   	 
	function a(){
		//$request_header = apache_request_headers();
		//$raw_request_body = http_get_request_headers();


		$creative_id = intval($_GET['creative_id']);
		$request = $this->get_request();



		$table_request = spClass('request');
		$table_campaign = spClass('campaign_meta');
		$table_creative = spClass('creative_meta');

		$creative_meta = $table_creative->find( array('id'=> $creative_id) );

		$campaign_id = $creative_meta['campaign_id'];
		$campaign_meta = $table_campaign->find(array('id' => $campaign_id));

		$campaign_url = $campaign_meta['url'];




	}
        
    
    }
